<script lang="ts" setup>
import {ref} from 'vue'
// import {RouterLink} from 'vue-router'
import {Search} from '@element-plus/icons-vue'
const activeIndex = ref('0')
const handleSelect = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
}
</script>

<template>
  <el-menu
    :default-active="activeIndex"
    class="el-menu-demo"
    mode="horizontal"
    text-color="#fff"
    background-color="#000"
    :ellipsis="false"
    @select="handleSelect"
  >
    <el-menu-item index="0">
      <router-link to="/">首页</router-link>
      </el-menu-item>
    <el-menu-item index="1">
      <router-link to="/personalcenter">个人中心</router-link>
     </el-menu-item>
    <el-menu-item index="2">
       <router-link to="/myorder">我的订单</router-link>
    </el-menu-item>
     <el-menu-item index="3">
       <router-link to="/homeview">商品列表详情</router-link>
    </el-menu-item>
     <el-menu-item index="4">
       <router-link to="/comdetail">商品详情</router-link>
    </el-menu-item>
    <el-menu-item index="5">
      <a href="https://gitee.com/go-like-dusts/vue3-mall-system">Gitee仓库地址</a>
    </el-menu-item>
    
    <div class="flex-grow" />
    <el-menu-item index="6">
      <router-link to="/login" class="login">登录</router-link>
    </el-menu-item>
    <el-menu-item index="7">
      <router-link to="/registration">注册</router-link>
    </el-menu-item>
    <el-menu-item index="8">
      <router-link to="/car" class="car">购物车</router-link>
    </el-menu-item>
  </el-menu>
  <el-row :gutter="20" class="search-img" justify="space-between">
    <el-col :span="12">
      <img src="http://mall.newbee.ltd/mall/image/login-logo-2.png" alt="商城">
    </el-col>
    <el-col :span="12">
      <el-input
      class="search-input"
      placeholder="请输入商品信息"
    />
    <el-button class="btn" type="default">
      <el-icon :size="25"><Search /></el-icon>
    </el-button>
    </el-col>
  </el-row>
</template>

<style lang="scss" scoped>
.el-menu-demo{
  padding: 0 200px;
  height: 60px;
  .el-menu-item:nth-child(-n+6){
    padding-right: 0;
  }
  .el-menu-item>a{
    list-style: none;
    text-decoration: none;
    height: 24px;
    padding: 5 0 5 20px;
    padding-right:20px;
    line-height: 24px;
  }
  .el-menu-item:nth-child(-n + 3)>a{
    border-right: 1px solid white;
  }
  .el-menu-item:nth-child(10){
    background-color: #1baeae;
    color: white;
    text-align: center;
  }
  .el-menu-item:nth-child(8):hover{
    background-color: aqua;
  }
  .login{
    border-right: 1px solid white;
  }
  .flex-grow {
  flex-grow: 1;
}
.car{
  padding-left: 18px;
}

}
.search-img{
  height: 100px;
  padding: 0 200px;
  .el-col{
    // text-align: center;
    img{
      width: 240px;
    }
  }
  .el-col:nth-child(2){
    display: flex;
    justify-content: flex-end;
    margin-top: -20px;
    align-items: center;
  }
  .search-input{
    width: 300px;
    height: 50px;
  }
  .btn{
    width: 50px;
    height: 50px;
  }
}

</style>